package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.dto.order.OrderLogReq;
import com.bto.solar.work.service.BtoOrderOperateLogService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 订单操作日志表 前端控制器
 * </p>
 *
 * @author adrian
 * @since 2023-08-09
 */
@RestController
@RequestMapping("/order-log")
public class OrderOperationLogController {
    @Autowired
    private BtoOrderOperateLogService btoOrderOperateLogService;

    @ApiModelProperty("操作记录")
    @PostMapping("opt")
    public R getOrderOperateLog(@RequestParam(required = false, defaultValue = "1") Integer pageNum,
                                @RequestParam(required = false, defaultValue = "20") Integer pageSize,
                                @RequestBody OrderLogReq orderLogReq) {
        return R.ok(btoOrderOperateLogService.getOrderOperateLog(pageNum , pageSize , orderLogReq));
    }

    @ApiModelProperty("查询审批记录")
    @PostMapping("approval")
    public R getOrderApprovalLog(@RequestBody OrderLogReq orderLogReq){
        return R.ok(btoOrderOperateLogService.getOrderApprovalLog(orderLogReq));
    }





}
